package com.hmdp.config;

import cn.hutool.core.bean.BeanUtil;
import com.hmdp.dto.UserDTO;
import com.hmdp.utils.ThreadLocalUser;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import java.util.Map;
import java.util.concurrent.TimeUnit;

import static com.hmdp.entity.RedisConstants.*;

/**
 * @create: 2022-03-07 19:52
 * @author: lazy-baby
 * @description:
 **/


public class LoginHandlerInterceptor implements HandlerInterceptor {
    /**
     * 前置拦截处理
     * @return
     * @throws Exception
     */
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
        return ThreadLocalUser.getUser() != null;
    }
}
